﻿using CID.Execution.Support.Information;

namespace CID.Execution.Support.PackageHandling
{
    public interface IPackageHandler
    {
        /// <summary>
        /// Prepare a package so that it can be used for deployment purposes by a Deployment Template
        /// </summary>
        /// <param name="packageInfo">An <see cref="PackageInfo"/> instance that represents the Deployment Package</param>
        /// <returns>An <see cref="IPackageHandlingToken"/> instance that can be used to handle the Deployment Package contents</returns>
        IPackageHandlingToken PrepareForUsage(PackageInfo packageInfo);

        /// <summary>
        /// Releases any resource allocated by a previous call to the <see cref="PrepareForUsage"/>
        /// </summary>
        /// <param name="packageHandlingToken">The <see cref="IPackageHandlingToken"/> instance returned by a previous call to the <see cref="PrepareForUsage"/></param>
        void Release(IPackageHandlingToken packageHandlingToken);
    }
}
